package top.kaoshanji.r2ch07g;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import top.kaoshanji.r2ch07f.Seller;
import top.kaoshanji.r2ch07f.Waiter;

/**
 * 代码清单-r2ch07g-262页a：测试一下DefaultAdvisorAutoProxyCreator
 * @author kaoshanji
 * ^_^
 * create time 2025/5/8 13:47
 */
public class DefaultAdvisorAutoProxyCreatorContext {

    public static void main(String[] args) {

        ApplicationContext context = new ClassPathXmlApplicationContext("r2ch07g/greeting-default-advisor-auto-proxy-beans.xml");

        Waiter waiter = (Waiter)context.getBean("waiter");
        Seller seller = (Seller)context.getBean("seller");

        waiter.serveTo("Join");
        waiter.greetTo("Join");
        seller.greetTo("Tom");

    }

}
